﻿using AntMovement.Core.Enum;
using AntMovement.Core.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AntMovement.Core.Entity
{
    [Serializable]
    public class DO
    {
        public Guid Id { get; set; }

        /// <summary>
        /// 索引号
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// IO顺序
        /// </summary>
        public int OrderlyNum { get; set; }

        /// <summary>
        /// 卡号
        /// </summary>
        public int CardNo { get; set; }

        /// <summary>
        /// 变量名
        /// </summary>
        public string Text { get; set; }

        /// <summary>
        /// 模块编号
        /// </summary>
        public int Mdl { get; set; }

        /// <summary>
        /// 当前模块对应索引
        /// </summary>
        public int MdlIndex { get; set; } = 0;

        /// <summary>
        /// 注释
        /// </summary>
        public string Note { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// 控制器名称
        /// </summary>
        public string MotionName { get; set; }

        /// <summary>
        /// 控制器类型
        /// </summary>
        public MotionType Type { get; set; }

        public string IP { get; set; }

        /// <summary>
        /// 禁用
        /// </summary>
        public bool Forbidden { get; set; }
        public int CompareTo(DO p)
        {
            int result = 0;
            if (Index == p.Index) result = 0;
            if (Index > p.Index) result = 1;
            if (Index < p.Index) result = -1;
            return result;
        }
    }
}
